/**
 * @file wa_screen_erase.h
 *
 */

#ifndef _WA_SCREEN_ERASE_H
#define _WA_SCREEN_ERASE_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/
#include "wa_conf.h"
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_misc.h"
#include "wa_area.h"
#include "wa_ll.h"
/*********************
*      DEFINES
*********************/

/**********************
*      TYPEDEFS
**********************/

typedef struct _wa_screen_erase
{
	wa_area rect;
	uint32_t unit_width;
	uint32_t unit_height;
	uint32_t erase_rate; //from 0 to 1000
	wa_result reverse;
	uint32_t prev_value;
	void (*erase_func)(struct _wa_screen_erase* scr);
}wa_screen_erase;

/**********************
* GLOBAL PROTOTYPES
**********************/
void wa_screen_erase_module_init(void);
wa_screen_erase* wa_screen_erase_create(void);
void wa_screen_erase_del(wa_screen_erase* scr);
void wa_screen_erase_set_area(wa_screen_erase* scr, int x, int y, int width, int height);
void wa_screen_erase_set_unit_size(wa_screen_erase* scr, int width, int height);
void wa_screen_erase_set_erase_rate(wa_screen_erase* scr, uint32_t erase_rate);
void wa_screen_erase_set_func(wa_screen_erase* scr, void(*func)(wa_screen_erase* scr));
void wa_screen_erase_set_reverse(wa_screen_erase* scr, wa_result reverse);
void wa_screen_erase_update(wa_screen_erase* scr);
void wa_screen_erase_handle(void);
void wa_screen_erase_func_blinds_horizontal(wa_screen_erase* scr);
void wa_screen_erase_func_blinds_vertical(wa_screen_erase* scr);

/**********************
*      MACROS
**********************/


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif

